package com.kxn.multi.module.admin.controller;

import com.kxn.multi.module.common.pojo.ApiResult;
import com.kxn.multi.module.common.util.CommonUtil;
import com.kxn.multi.module.common.util.TestUtil;
import com.kxn.multi.module.service.service.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @Resource(name="commonService")
    CommonService commonService;

    @Resource
    TestUtil testUtil;

    @Resource
    CommonUtil commonUtil;

    @GetMapping("/test")
    public ApiResult test() {
        long ts = commonService.getTimestamp();
        String str = String.valueOf("admin:" + ts);
        return ApiResult.success(str);
    }

    @GetMapping("/test1")
    public String test1() {
        String name = commonUtil.getName();
        return name;
    }
}
